package com.example.keylistener;

import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.Console;

public class KeyListenerMain extends KeyAdapter {

    @Override
    public void keyTyped(KeyEvent e) {
        System.out.println(e);
    }

    @Override
    public void keyPressed(KeyEvent e) {
        System.out.println(e);

    }

    @Override
    public void keyReleased(KeyEvent e) {
        System.out.println(e);

    }

    public static void main(String[] args) {
        KeyListenerMain keyListenerMain = new KeyListenerMain();
//        addKeyListener(keyListenerMain);
        Console console = System.console();
    }
}
